package com.bruce.downloader.handle;

import org.springframework.http.client.ClientHttpResponse;
import org.springframework.web.client.ResponseExtractor;

import java.io.IOException;

public abstract class AbstractResponseExtractor<T> implements ResponseExtractor<T> {
    protected static byte[] BYTE = new byte[1024*100];
    @Override
    public T extractData(ClientHttpResponse clientHttpResponse) throws IOException {
        return doExtractData(clientHttpResponse);
    }

    protected abstract T doExtractData(ClientHttpResponse clientHttpResponse) throws IOException;
}
